
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>开发与调试 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    
    <link rel="prev" href="hello.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <span>
            
                    
                    入门
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="environment.html">
            
                <a href="environment.html">
            
                    
                    环境搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="hello.html">
            
                <a href="hello.html">
            
                    
                    HelloWorld
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.3" data-path="dev-and-debug.html">
            
                <a href="dev-and-debug.html">
            
                    
                    开发与调试
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    参考
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../framework/file.html">
            
                <a href="../framework/file.html">
            
                    
                    文件组织
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../framework/manifest.html">
            
                <a href="../framework/manifest.html">
            
                    
                    manifest文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../framework/nml.html">
            
                <a href="../framework/nml.html">
            
                    
                    nml文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../framework/page.html">
            
                <a href="../framework/page.html">
            
                    
                    页面与组件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    组件
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../component/general.html">
            
                <a href="../component/general.html">
            
                    
                    通用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../component/container.html">
            
                <a href="../component/container.html">
            
                    
                    容器组件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../component/basics.html">
            
                <a href="../component/basics.html">
            
                    
                    基础组件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../component/form.html">
            
                <a href="../component/form.html">
            
                    
                    表单组件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../component/media.html">
            
                <a href="../component/media.html">
            
                    
                    媒体组件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    接口
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../api/general.html">
            
                <a href="../api/general.html">
            
                    
                    通用规则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../api/basic.html">
            
                <a href="../api/basic.html">
            
                    
                    基本功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../api/interface.html">
            
                <a href="../api/interface.html">
            
                    
                    界面交互
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="../api/request.html">
            
                <a href="../api/request.html">
            
                    
                    网络访问
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="../api/storage.html">
            
                <a href="../api/storage.html">
            
                    
                    文件数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="../api/system.html">
            
                <a href="../api/system.html">
            
                    
                    系统能力
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="../api/media.html">
            
                <a href="../api/media.html">
            
                    
                    图形图像
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="../api/share.html">
            
                <a href="../api/share.html">
            
                    
                    分享
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.9" data-path="../api/pay.html">
            
                <a href="../api/pay.html">
            
                    
                    支付
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.10" data-path="../api/stat.html">
            
                <a href="../api/stat.html">
            
                    
                    统计
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >开发与调试</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x5F00;&#x53D1;&#x4E0E;&#x8C03;&#x8BD5;">&#x5F00;&#x53D1;&#x4E0E;&#x8C03;&#x8BD5;</h2>
<p>&#x5728;&#x9605;&#x8BFB;&#x6B64;&#x90E8;&#x5206;&#x5185;&#x5BB9;&#x4E4B;&#x524D;&#xFF0C;&#x8BF7;&#x5148;&#x5B8C;&#x6210;&#x201C;&#x5165;&#x95E8;-&gt;HelloWorld&#x201D;&#x90E8;&#x5206;&#x5173;&#x4E8E;&#x771F;&#x673A;&#x8C03;&#x8BD5;&#x7684;&#x5185;&#x5BB9;&#x3002;</p>
<h3 id="&#x4F7F;&#x7528;&#x65E5;&#x5FD7;&#x8F93;&#x51FA;">&#x4F7F;&#x7528;&#x65E5;&#x5FD7;&#x8F93;&#x51FA;</h3>
<h4 id="&#x4FEE;&#x6539;&#x65E5;&#x5FD7;&#x7B49;&#x7EA7;">&#x4FEE;&#x6539;&#x65E5;&#x5FD7;&#x7B49;&#x7EA7;</h4>
<p>&#x9879;&#x76EE;&#x6839;&#x76EE;&#x5F55;&#x4E0B;&#x7684; manifest.json &#x6587;&#x4EF6;&#x4E2D;&#xFF0C;config-&gt;logLevel &#x9ED8;&#x8BA4;&#x662F; debug&#xFF0C;&#x5373;&#xFF1A;&#x5141;&#x8BB8;&#x6240;&#x6709;&#x7EA7;&#x522B;&#x7684;&#x65E5;&#x5FD7;&#x8F93;&#x51FA;&#x3002;</p>
<pre><code>&quot;config&quot;: {
  &quot;logLevel&quot;: &quot;debug&quot;/*&#x6253;&#x5370;&#x65E5;&#x5FD7;&#x7B49;&#x7EA7;*/
},
</code></pre><h4 id="&#x5728;-js-&#x4E2D;&#x8F93;&#x51FA;&#x65E5;&#x5FD7;">&#x5728; JS &#x4E2D;&#x8F93;&#x51FA;&#x65E5;&#x5FD7;</h4>
<p>&#x8F93;&#x51FA;&#x65E5;&#x5FD7;&#x80FD;&#x5E2E;&#x52A9;&#x5F00;&#x53D1;&#x8005;&#x5FEB;&#x901F;&#x5B9A;&#x4F4D;&#x95EE;&#x9898;&#xFF0C;&#x4E0E;&#x4F20;&#x7EDF;&#x524D;&#x7AEF;&#x5F00;&#x53D1;&#x4E00;&#x6837;&#xFF0C;&#x4F7F;&#x7528; console &#x8F93;&#x51FA;&#x65E5;&#x5FD7;&#x3002;</p>
<pre><code>console.debug(&apos;debug&apos;);
console.log(&apos;log&apos;);
console.info(&apos;info&apos;);
console.warn(&apos;warn&apos;);
console.error(&apos;error&apos;);
</code></pre><h4 id="&#x67E5;&#x770B;&#x65E5;&#x5FD7;">&#x67E5;&#x770B;&#x65E5;&#x5FD7;</h4>
<p>&#x901A;&#x8FC7;<strong>&#x8FDC;&#x7A0B;&#x8C03;&#x8BD5;</strong>&#x67E5;&#x770B;&#x8F93;&#x51FA;&#x7684;&#x65E5;&#x5FD7;&#x3002;</p>
<h3 id="&#x8FDC;&#x7A0B;&#x8C03;&#x8BD5;">&#x8FDC;&#x7A0B;&#x8C03;&#x8BD5;</h3>
<p>&#x8FDC;&#x7A0B;&#x8C03;&#x8BD5;&#x6307;&#x7684;&#x662F;&#x901A;&#x8FC7; HBuilderX &#x7684;&#x5DE5;&#x5177;&#x8C03;&#x8BD5;&#x624B;&#x673A; App &#x7AEF;&#x7684;&#x9875;&#x9762;&#x3002;</p>
<ul>
<li>&#x83DC;&#x5355;-&gt;&#x8FD0;&#x884C;-&gt;Debug&#x8C03;&#x8BD5;-&gt;&#x8BBE;&#x5907;</li>
<li>&#x8C03;&#x8BD5;&#x670D;&#x52A1;&#x542F;&#x52A8;&#x6210;&#x529F;&#x540E;&#xFF0C;&#x4F1A;&#x81EA;&#x52A8;&#x6253;&#x5F00; Chrome &#x6D4F;&#x89C8;&#x5668;&#x3002;</li>
<li>&#x5F53;&#x624B;&#x673A;&#x8BBE;&#x5907;&#x4E0A;&#x7684;&#x5E94;&#x7528;&#x542F;&#x52A8;&#x6210;&#x529F;&#x540E;&#xFF0C;&#x53EF;&#x4EE5;&#x5728;&#x8C03;&#x8BD5;&#x5DE5;&#x5177;&#x754C;&#x9762;&#x770B;&#x5230;&#x5E94;&#x7528;&#x4FE1;&#x606F;&#x3002;</li>
<li>&#x6309;&#x7167;&#x8C03;&#x8BD5;&#x5DE5;&#x5177;&#x754C;&#x9762;&#x7684;&#x8BF4;&#x660E;&#xFF0C;&#x5C31;&#x53EF;&#x4EE5;&#x8FDB;&#x884C; JS &#x65AD;&#x70B9;&#xFF0C;&#x67E5;&#x770B;&#x65E5;&#x5FD7;&#xFF0C;&#x9875;&#x9762;&#x5E03;&#x5C40;&#x7B49;&#x8C03;&#x8BD5;&#x5DE5;&#x4F5C;&#x3002;</li>
</ul>
<h3 id="debugger">Debugger</h3>
<blockquote>
<p>Debugger &#x529F;&#x80FD;&#x53EF;&#x4EE5;&#x5BF9; UniApp &#x9875;&#x9762;&#x4E2D;&#x7684; js &#x8FDB;&#x884C;&#x8C03;&#x8BD5;&#x3002;</p>
</blockquote>
<h4 id="&#x65AD;&#x70B9;">&#x65AD;&#x70B9;</h4>
<p>&#x627E;&#x5230;&#x76EE;&#x6807;&#x9875;&#x9762;&#x7684; JS&#xFF0C;&#x7136;&#x540E;&#x5C31;&#x53EF;&#x4EE5;&#x50CF;&#x5F00;&#x53D1;&#x7F51;&#x9875;&#x4E00;&#x6837;&#x8FDB;&#x884C;&#x65AD;&#x70B9;&#x8C03;&#x8BD5;&#x3002;</p>
<p>&#x4EE5; hello-uniapp &#x7684; Home &#x9875;&#x4E3A;&#x4F8B;&#xFF1A;Sources panel -&gt; Network -&gt; Runtime.js -&gt; 192.xxx:port -&gt; source -&gt; file:/ -&gt; Home &#x5C31;&#x662F;&#x6700;&#x7EC8;&#x7F16;&#x8BD1;&#x540E;&#x7684;&#x9875;&#x9762; JS&#x3002;</p>
<p>&#x627E;&#x5230; showDetail &#x65B9;&#x6CD5;&#x6DFB;&#x52A0;&#x4E00;&#x4E2A;&#x65AD;&#x70B9;&#xFF0C;&#x5728;&#x624B;&#x673A;&#x8BBE;&#x5907;&#x4E0A;&#x8FDB;&#x884C;&#x89E6;&#x53D1;&#x6B64;&#x65B9;&#x6CD5;&#x7684;&#x64CD;&#x4F5C;&#xFF0C;&#x7136;&#x540E;&#x5C31;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x65AD;&#x70B9;&#x751F;&#x6548;&#xFF0C;&#x5E76;&#x8FDB;&#x884C;&#x540E;&#x7EED;&#x7684;&#x8C03;&#x8BD5;&#x3002;</p>
<p><img src="https://img-cdn-qiniu.dcloud.net.cn/uploads/images/debugger.png" alt="&#x8FD9;&#x91CC;&#x653E;&#x4E2A;&#x56FE;"></p>
<h4 id="&#x65E5;&#x5FD7;">&#x65E5;&#x5FD7;</h4>
<p>&#x5728; Console panel &#x53EF;&#x4EE5;&#x770B;&#x5230; JS &#x4E2D;&#x8F93;&#x51FA;&#x7684;&#x65E5;&#x5FD7;&#x4FE1;&#x606F;&#x3002;</p>
<h3 id="inspector">Inspector</h3>
<blockquote>
<p>Inspector&#x529F;&#x80FD;&#x53EF;&#x67E5;&#x770B;&#x9875;&#x9762;&#x7684; VDOM/Native Tree &#x7ED3;&#x6784;</p>
</blockquote>
<p>ElmentMode &#x5207;&#x6362;&#x4E3A; vdom&#xFF0C;&#x70B9;&#x51FB; Inspector &#x6253;&#x5F00;&#x9875;&#x9762;&#x7ED3;&#x6784;&#x7684;&#x7A97;&#x53E3;&#x3002;</p>
<p>&#x5DE6;&#x4FA7;&#x4E3A;&#x6548;&#x679C;&#x9884;&#x89C8;&#x533A;&#x57DF;&#xFF0C;&#x53F3;&#x4FA7;&#x4E3A;&#x5F00;&#x53D1;&#x8005;&#x5DE5;&#x5177;&#x3002;&#x901A;&#x8FC7;&#x5F00;&#x53D1;&#x8005;&#x5DE5;&#x5177;&#x5DE6;&#x4E0A;&#x89D2;&#x7684;&#x9009;&#x62E9;&#x5668;&#xFF0C;&#x53EF;&#x4EE5;&#x5FEB;&#x901F;&#x5B9A;&#x4F4D;&#x9875;&#x9762;&#x4E2D;&#x7684;&#x7EC4;&#x4EF6;&#x5BF9;&#x5E94;&#x7684;&#x9875;&#x9762;&#x7ED3;&#x6784;&#x53CA; nss &#x5C5E;&#x6027;&#x3002;
<img src="https://img-cdn-qiniu.dcloud.net.cn/uploads/images/vdom.png" alt="&#x8FD9;&#x91CC;&#x653E;&#x4E2A;&#x56FE;"></p>
<ul>
<li>virtual &#x8868;&#x793A;&#x5B9E;&#x9645;&#x8BA1;&#x7B97;&#x540E;&#x7684;&#x7ED3;&#x679C;</li>
<li>local &#x8868;&#x793A;&#x539F;&#x59CB;&#x8BBE;&#x7F6E;&#x7684;&#x503C;</li>
</ul>
<p>ElmentMode &#x9ED8;&#x8BA4;&#x4E3A; native&#xFF0C;&#x53EF;&#x4EE5;&#x67E5;&#x770B;&#x539F;&#x751F;&#x7684;&#x9875;&#x9762;&#x7ED3;&#x6784;&#x3002;&#x8FD9;&#x4E2A;&#x529F;&#x80FD;&#x53EA;&#x662F;&#x7528;&#x4F5C;&#x9884;&#x89C8;&#xFF0C;&#x6CA1;&#x6709;&#x5176;&#x5B83;&#x66F4;&#x591A;&#x7684;&#x4F5C;&#x7528;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="hello.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: HelloWorld">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"开发与调试","level":"1.2.3","depth":2,"next":{"title":"参考","level":"1.3","depth":1,"ref":"","articles":[{"title":"文件组织","level":"1.3.1","depth":2,"path":"framework/file.md","ref":"framework/file.md","articles":[]},{"title":"manifest文件","level":"1.3.2","depth":2,"path":"framework/manifest.md","ref":"framework/manifest.md","articles":[]},{"title":"nml文件","level":"1.3.3","depth":2,"path":"framework/nml.md","ref":"framework/nml.md","articles":[]},{"title":"页面与组件","level":"1.3.4","depth":2,"path":"framework/page.md","ref":"framework/page.md","articles":[]}]},"previous":{"title":"HelloWorld","level":"1.2.2","depth":2,"path":"introduction/hello.md","ref":"introduction/hello.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"introduction/dev-and-debug.md","mtime":"2018-04-09T11:47:40.778Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-04-09T11:47:45.113Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

